let stu = {
    id:1,
    name:"xiaofei",
    classes:{
        id:1,
        name:"web10期"
    }
}

//不叫拷贝。赋值
// let stu2 = stu
let stu2 = {}
for (const key in stu) {
    if(stu.hasOwnProperty(key)){
        stu2[key] = stu[key]
    }
    
}

console.log(stu == stu2);  //false
console.log(stu.classes == stu2.classes); //true

let stu3 = {...stu}

const stu4 = Object.assign({},stu)

